#include <iostream>
#include <limits>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::istream;
using std::string;

void checkStatus(const istream & is){
    /* int num = 0; */
    /* is >> num; */
    cout << "is's goodbit:" << is.good() << endl;
    cout << "is's badbit:" << is.bad() << endl;
    cout << "is's failbit:" << is.fail() << endl;
    cout << "is's eofbit:" << is.eof() << endl;
    cout << endl;
}

void test0(){
    checkStatus(cin);
    int num = 10;
    cin >> num;
    cout << "num:" << num << endl;
    checkStatus(cin);


    if(!cin.good()){
        //恢复流的状态
        cin.clear();
        //清空缓冲区
        cin.ignore(std::numeric_limits<std::streamsize>::max(),'\n');
    }
    checkStatus(cin);

    string line;
    cin >> line;
    cout << "line:" << line << endl;
    checkStatus(cin);


    /* int num2 = 5; */
    /* cin >> num2; */
    /* cout << "num2:" << num2 << endl; */
    /* checkStatus(cin); */
}

int main(void){
    test0();
    return 0;
}
